<?php
/**
 * Created by PhpStorm.
 * User: sunshubo
 * Date: 2017/12/17
 * Time: 22:57
 */

class CreateActiveInfo_model extends MY_Model
{
    function create_info($body)
    {
        $table_list = "ws_active_list";
        $table_record = "ws_active_record";
        $body = json_decode($body)->data;
        $data_list = array('title' => $body->title, 'start_date' => $body->startTime, 'end_date' => $body->endTime, 'pay_open' => $body->pay_open, 'pay' => $body->pay, 'type' => $body->type, 'active_date' => $body->activeDate . ' ' . $body->activeTime);
        $result_id = $this->my_insert($table_list, $data_list);
        $data_record = array('aId' => $result_id);
        $this->my_insert($table_record, $data_record);
        return $result_id;
    }
}